
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>redis16 RedisUtil · Redis</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="<yangxin19970404@163.com>">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="redis17 Redis.config详解.html" />
    
    
    <link rel="prev" href="redis15 springBoot整合redis.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="redis01 redis开始.html">
            
                <a href="redis01 redis开始.html">
            
                    
                    redis01 redis开始
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="redis02 redis安装.html">
            
                <a href="redis02 redis安装.html">
            
                    
                    redis02 redis安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="redis03 redis基础知识.html">
            
                <a href="redis03 redis基础知识.html">
            
                    
                    redis03 redis基础知识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="redis04 String数据类型详解.html">
            
                <a href="redis04 String数据类型详解.html">
            
                    
                    redis04 String数据类型详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="redis05 List数据类型详解.html">
            
                <a href="redis05 List数据类型详解.html">
            
                    
                    redis05 List数据类型详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="redis06 Set数据类型详解.html">
            
                <a href="redis06 Set数据类型详解.html">
            
                    
                    redis06 Set数据类型详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="redis07 Hash数据类型详解.html">
            
                <a href="redis07 Hash数据类型详解.html">
            
                    
                    redis07 Hash数据类型详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="redis08 Zset数据类型详解.html">
            
                <a href="redis08 Zset数据类型详解.html">
            
                    
                    redis08 Zset数据类型详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="redis09 Geospatial地理位置详解.html">
            
                <a href="redis09 Geospatial地理位置详解.html">
            
                    
                    redis09 Geospatial地理位置详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="redis10 Hyperloglog基数统计详解.html">
            
                <a href="redis10 Hyperloglog基数统计详解.html">
            
                    
                    redis10 Hyperloglog基数统计详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="redis11 Bitmap位图场景详解.html">
            
                <a href="redis11 Bitmap位图场景详解.html">
            
                    
                    redis11 Bitmap位图场景详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="redis12 Redis事务操作.html">
            
                <a href="redis12 Redis事务操作.html">
            
                    
                    redis12 Redis事务操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="redis13 Redis实现乐观锁.html">
            
                <a href="redis13 Redis实现乐观锁.html">
            
                    
                    redis13 Redis实现乐观锁
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="redis14 Jedis.html">
            
                <a href="redis14 Jedis.html">
            
                    
                    redis14 Jedis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="redis15 springBoot整合redis.html">
            
                <a href="redis15 springBoot整合redis.html">
            
                    
                    redis15 springBoot整合redis
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.17" data-path="redis16 RedisUtil.html">
            
                <a href="redis16 RedisUtil.html">
            
                    
                    redis16 RedisUtil
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18" data-path="redis17 Redis.config详解.html">
            
                <a href="redis17 Redis.config详解.html">
            
                    
                    redis17 Redis.config详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19" data-path="redis18 Redis持久化RDB.html">
            
                <a href="redis18 Redis持久化RDB.html">
            
                    
                    redis18 Redis持久化RDB
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.20" data-path="redis19 Redis持久化AOF.html">
            
                <a href="redis19 Redis持久化AOF.html">
            
                    
                    redis19 Redis持久化AOF
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21" data-path="redis20 Redis发布订阅.html">
            
                <a href="redis20 Redis发布订阅.html">
            
                    
                    redis20 Redis发布订阅
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.22" data-path="redis21 Redis主动复制.html">
            
                <a href="redis21 Redis主动复制.html">
            
                    
                    redis21 Redis主动复制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.23" data-path="redis21 Redis哨兵模式.html">
            
                <a href="redis21 Redis哨兵模式.html">
            
                    
                    redis21 Redis哨兵模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.24" data-path="redis22 Redis缓存穿透和雪崩.html">
            
                <a href="redis22 Redis缓存穿透和雪崩.html">
            
                    
                    redis22 Redis缓存穿透和雪崩
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >redis16 RedisUtil</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h4 id="redisutil-&#x5DE5;&#x5177;&#x7C7B;">RedisUtil &#x5DE5;&#x5177;&#x7C7B;</h4>
<pre><code class="lang-java"><span class="hljs-keyword">package</span> com.yang.config;
<span class="hljs-keyword">import</span> org.springframework.data.redis.connection.DataType;
<span class="hljs-keyword">import</span> org.springframework.data.redis.core.Cursor;
<span class="hljs-keyword">import</span> org.springframework.data.redis.core.ScanOptions;
<span class="hljs-keyword">import</span> org.springframework.data.redis.core.StringRedisTemplate;
<span class="hljs-keyword">import</span> org.springframework.data.redis.core.ZSetOperations.TypedTuple;

<span class="hljs-keyword">import</span> java.util.Collection;
<span class="hljs-keyword">import</span> java.util.Date;
<span class="hljs-keyword">import</span> java.util.List;
<span class="hljs-keyword">import</span> java.util.Map;
<span class="hljs-keyword">import</span> java.util.Map.Entry;
<span class="hljs-keyword">import</span> java.util.Set;
<span class="hljs-keyword">import</span> java.util.concurrent.TimeUnit;

<span class="hljs-comment">/**
 * Redis&#x5DE5;&#x5177;&#x7C7B;
 *
 * <span class="hljs-doctag">@date</span> 2020 -03-19 
 */</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">RedisUtil</span> </span>{
    <span class="hljs-keyword">private</span> StringRedisTemplate redisTemplate;

    <span class="hljs-comment">/**
     * Sets redis template.
     *
     * <span class="hljs-doctag">@param</span> redisTemplate the redis template
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setRedisTemplate</span><span class="hljs-params">(StringRedisTemplate redisTemplate)</span> </span>{
        <span class="hljs-keyword">this</span>.redisTemplate = redisTemplate;
    }

    <span class="hljs-comment">/**
     * Gets redis template.
     *
     * <span class="hljs-doctag">@return</span> the redis template
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> StringRedisTemplate <span class="hljs-title">getRedisTemplate</span><span class="hljs-params">()</span> </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.redisTemplate;
    }

    <span class="hljs-comment">/** -------------------key&#x76F8;&#x5173;&#x64CD;&#x4F5C;--------------------- */</span>

    <span class="hljs-comment">/**
     * &#x5220;&#x9664;key
     *
     * <span class="hljs-doctag">@param</span> key the key
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">delete</span><span class="hljs-params">(String key)</span> </span>{
        redisTemplate.delete(key);
    }

    <span class="hljs-comment">/**
     * &#x6279;&#x91CF;&#x5220;&#x9664;key
     *
     * <span class="hljs-doctag">@param</span> keys the keys
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">delete</span><span class="hljs-params">(Collection&lt;String&gt; keys)</span> </span>{
        redisTemplate.delete(keys);
    }

    <span class="hljs-comment">/**
     * &#x5E8F;&#x5217;&#x5316;key
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the byte [ ]
     */</span>
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">byte</span>[] dump(String key) {
        <span class="hljs-keyword">return</span> redisTemplate.dump(key);
    }

    <span class="hljs-comment">/**
     * &#x662F;&#x5426;&#x5B58;&#x5728;key
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the boolean
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Boolean <span class="hljs-title">hasKey</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.hasKey(key);
    }

    <span class="hljs-comment">/**
     * &#x8BBE;&#x7F6E;&#x8FC7;&#x671F;&#x65F6;&#x95F4;
     *
     * <span class="hljs-doctag">@param</span> key     the key
     * <span class="hljs-doctag">@param</span> timeout the timeout
     * <span class="hljs-doctag">@param</span> unit    the unit
     * <span class="hljs-doctag">@return</span> the boolean
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Boolean <span class="hljs-title">expire</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> timeout, TimeUnit unit)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.expire(key, timeout, unit);
    }

    <span class="hljs-comment">/**
     * &#x8BBE;&#x7F6E;&#x8FC7;&#x671F;&#x65F6;&#x95F4;
     *
     * <span class="hljs-doctag">@param</span> key  the key
     * <span class="hljs-doctag">@param</span> date the date
     * <span class="hljs-doctag">@return</span> the boolean
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Boolean <span class="hljs-title">expireAt</span><span class="hljs-params">(String key, Date date)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.expireAt(key, date);
    }

    <span class="hljs-comment">/**
     * &#x67E5;&#x627E;&#x5339;&#x914D;&#x7684;key
     *
     * <span class="hljs-doctag">@param</span> pattern the pattern
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">keys</span><span class="hljs-params">(String pattern)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.keys(pattern);
    }

    <span class="hljs-comment">/**
     * &#x5C06;&#x5F53;&#x524D;&#x6570;&#x636E;&#x5E93;&#x7684; key &#x79FB;&#x52A8;&#x5230;&#x7ED9;&#x5B9A;&#x7684;&#x6570;&#x636E;&#x5E93; db &#x5F53;&#x4E2D;
     *
     * <span class="hljs-doctag">@param</span> key     the key
     * <span class="hljs-doctag">@param</span> dbIndex the db index
     * <span class="hljs-doctag">@return</span> the boolean
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Boolean <span class="hljs-title">move</span><span class="hljs-params">(String key, <span class="hljs-keyword">int</span> dbIndex)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.move(key, dbIndex);
    }

    <span class="hljs-comment">/**
     * &#x79FB;&#x9664; key &#x7684;&#x8FC7;&#x671F;&#x65F6;&#x95F4;&#xFF0C;key &#x5C06;&#x6301;&#x4E45;&#x4FDD;&#x6301;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the boolean
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Boolean <span class="hljs-title">persist</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.persist(key);
    }

    <span class="hljs-comment">/**
     * &#x8FD4;&#x56DE; key &#x7684;&#x5269;&#x4F59;&#x7684;&#x8FC7;&#x671F;&#x65F6;&#x95F4;
     *
     * <span class="hljs-doctag">@param</span> key  the key
     * <span class="hljs-doctag">@param</span> unit the unit
     * <span class="hljs-doctag">@return</span> the expire
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">getExpire</span><span class="hljs-params">(String key, TimeUnit unit)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.getExpire(key, unit);
    }

    <span class="hljs-comment">/**
     * &#x8FD4;&#x56DE; key &#x7684;&#x5269;&#x4F59;&#x7684;&#x8FC7;&#x671F;&#x65F6;&#x95F4;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the expire
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">getExpire</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.getExpire(key);
    }

    <span class="hljs-comment">/**
     * &#x4ECE;&#x5F53;&#x524D;&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x968F;&#x673A;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A; key
     *
     * <span class="hljs-doctag">@return</span> the string
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">randomKey</span><span class="hljs-params">()</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.randomKey();
    }

    <span class="hljs-comment">/**
     * &#x4FEE;&#x6539; key &#x7684;&#x540D;&#x79F0;
     *
     * <span class="hljs-doctag">@param</span> oldKey the old key
     * <span class="hljs-doctag">@param</span> newKey the new key
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">rename</span><span class="hljs-params">(String oldKey, String newKey)</span> </span>{
        redisTemplate.rename(oldKey, newKey);
    }

    <span class="hljs-comment">/**
     * &#x4EC5;&#x5F53; newkey &#x4E0D;&#x5B58;&#x5728;&#x65F6;&#xFF0C;&#x5C06; oldKey &#x6539;&#x540D;&#x4E3A; newkey
     *
     * <span class="hljs-doctag">@param</span> oldKey the old key
     * <span class="hljs-doctag">@param</span> newKey the new key
     * <span class="hljs-doctag">@return</span> the boolean
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Boolean <span class="hljs-title">renameIfAbsent</span><span class="hljs-params">(String oldKey, String newKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.renameIfAbsent(oldKey, newKey);
    }

    <span class="hljs-comment">/**
     * &#x8FD4;&#x56DE; key &#x6240;&#x50A8;&#x5B58;&#x7684;&#x503C;&#x7684;&#x7C7B;&#x578B;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the data type
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> DataType <span class="hljs-title">type</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.type(key);
    }

    <span class="hljs-comment">/** -------------------string&#x76F8;&#x5173;&#x64CD;&#x4F5C;--------------------- */</span>

    <span class="hljs-comment">/**
     * &#x8BBE;&#x7F6E;&#x6307;&#x5B9A; key &#x7684;&#x503C;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">set</span><span class="hljs-params">(String key, String value)</span> </span>{
        redisTemplate.opsForValue().set(key, value);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x6307;&#x5B9A; key &#x7684;&#x503C;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the string
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">get</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForValue().get(key);
    }

    <span class="hljs-comment">/**
     * &#x8FD4;&#x56DE; key &#x4E2D;&#x5B57;&#x7B26;&#x4E32;&#x503C;&#x7684;&#x5B50;&#x5B57;&#x7B26;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> start the start
     * <span class="hljs-doctag">@param</span> end   the end
     * <span class="hljs-doctag">@return</span> the range
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">getRange</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> start, <span class="hljs-keyword">long</span> end)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForValue().get(key, start, end);
    }

    <span class="hljs-comment">/**
     * &#x5C06;&#x7ED9;&#x5B9A; key &#x7684;&#x503C;&#x8BBE;&#x4E3A; value &#xFF0C;&#x5E76;&#x8FD4;&#x56DE; key &#x7684;&#x65E7;&#x503C;(old value)
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the and set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">getAndSet</span><span class="hljs-params">(String key, String value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForValue().getAndSet(key, value);
    }

    <span class="hljs-comment">/**
     * &#x5BF9; key &#x6240;&#x50A8;&#x5B58;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x503C;&#xFF0C;&#x83B7;&#x53D6;&#x6307;&#x5B9A;&#x504F;&#x79FB;&#x91CF;&#x4E0A;&#x7684;&#x4F4D;(bit)
     *
     * <span class="hljs-doctag">@param</span> key    the key
     * <span class="hljs-doctag">@param</span> offset the offset
     * <span class="hljs-doctag">@return</span> the bit
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Boolean <span class="hljs-title">getBit</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> offset)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForValue().getBit(key, offset);
    }

    <span class="hljs-comment">/**
     * &#x6279;&#x91CF;&#x83B7;&#x53D6;
     *
     * <span class="hljs-doctag">@param</span> keys the keys
     * <span class="hljs-doctag">@return</span> the list
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> List&lt;String&gt; <span class="hljs-title">multiGet</span><span class="hljs-params">(Collection&lt;String&gt; keys)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForValue().multiGet(keys);
    }

    <span class="hljs-comment">/**
     * &#x8BBE;&#x7F6E;ASCII&#x7801;, &#x5B57;&#x7B26;&#x4E32;&apos;a&apos;&#x7684;ASCII&#x7801;&#x662F;97, &#x8F6C;&#x4E3A;&#x4E8C;&#x8FDB;&#x5236;&#x662F;&apos;01100001&apos;, &#x6B64;&#x65B9;&#x6CD5;&#x662F;&#x5C06;&#x4E8C;&#x8FDB;&#x5236;&#x7B2C;offset&#x4F4D;&#x503C;&#x53D8;&#x4E3A;value
     *
     * <span class="hljs-doctag">@param</span> key    &#x4F4D;&#x7F6E;
     * <span class="hljs-doctag">@param</span> offset the offset
     * <span class="hljs-doctag">@param</span> value  &#x503C;,true&#x4E3A;1, false&#x4E3A;0
     * <span class="hljs-doctag">@return</span> the bit
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">boolean</span> <span class="hljs-title">setBit</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> offset, <span class="hljs-keyword">boolean</span> value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForValue().setBit(key, offset, value);
    }

    <span class="hljs-comment">/**
     * &#x5C06;&#x503C; value &#x5173;&#x8054;&#x5230; key &#xFF0C;&#x5E76;&#x5C06; key &#x7684;&#x8FC7;&#x671F;&#x65F6;&#x95F4;&#x8BBE;&#x4E3A; timeout
     *
     * <span class="hljs-doctag">@param</span> key     the key
     * <span class="hljs-doctag">@param</span> value   the value
     * <span class="hljs-doctag">@param</span> timeout &#x8FC7;&#x671F;&#x65F6;&#x95F4;
     * <span class="hljs-doctag">@param</span> unit    &#x65F6;&#x95F4;&#x5355;&#x4F4D;, &#x5929;:TimeUnit.DAYS &#x5C0F;&#x65F6;:TimeUnit.HOURS &#x5206;&#x949F;:TimeUnit.MINUTES            &#x79D2;:TimeUnit.SECONDS &#x6BEB;&#x79D2;:TimeUnit.MILLISECONDS
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setEx</span><span class="hljs-params">(String key, String value, <span class="hljs-keyword">long</span> timeout, TimeUnit unit)</span> </span>{
        redisTemplate.opsForValue().set(key, value, timeout, unit);
    }

    <span class="hljs-comment">/**
     * &#x53EA;&#x6709;&#x5728; key &#x4E0D;&#x5B58;&#x5728;&#x65F6;&#x8BBE;&#x7F6E; key &#x7684;&#x503C;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value &#x4E4B;&#x524D;&#x5DF2;&#x7ECF;&#x5B58;&#x5728;&#x8FD4;&#x56DE;false,&#x4E0D;&#x5B58;&#x5728;&#x8FD4;&#x56DE;true
     * <span class="hljs-doctag">@return</span> the if absent
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">boolean</span> <span class="hljs-title">setIfAbsent</span><span class="hljs-params">(String key, String value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForValue().setIfAbsent(key, value);
    }

    <span class="hljs-comment">/**
     * &#x7528; value &#x53C2;&#x6570;&#x8986;&#x5199;&#x7ED9;&#x5B9A; key &#x6240;&#x50A8;&#x5B58;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x503C;&#xFF0C;&#x4ECE;&#x504F;&#x79FB;&#x91CF; offset &#x5F00;&#x59CB;
     *
     * <span class="hljs-doctag">@param</span> key    the key
     * <span class="hljs-doctag">@param</span> value  the value
     * <span class="hljs-doctag">@param</span> offset &#x4ECE;&#x6307;&#x5B9A;&#x4F4D;&#x7F6E;&#x5F00;&#x59CB;&#x8986;&#x5199;
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setRange</span><span class="hljs-params">(String key, String value, <span class="hljs-keyword">long</span> offset)</span> </span>{
        redisTemplate.opsForValue().set(key, value, offset);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x5B57;&#x7B26;&#x4E32;&#x7684;&#x957F;&#x5EA6;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">size</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForValue().size(key);
    }

    <span class="hljs-comment">/**
     * &#x6279;&#x91CF;&#x6DFB;&#x52A0;
     *
     * <span class="hljs-doctag">@param</span> maps the maps
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">multiSet</span><span class="hljs-params">(Map&lt;String, String&gt; maps)</span> </span>{
        redisTemplate.opsForValue().multiSet(maps);
    }

    <span class="hljs-comment">/**
     * &#x540C;&#x65F6;&#x8BBE;&#x7F6E;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A; key-value &#x5BF9;&#xFF0C;&#x5F53;&#x4E14;&#x4EC5;&#x5F53;&#x6240;&#x6709;&#x7ED9;&#x5B9A; key &#x90FD;&#x4E0D;&#x5B58;&#x5728;
     *
     * <span class="hljs-doctag">@param</span> maps &#x4E4B;&#x524D;&#x5DF2;&#x7ECF;&#x5B58;&#x5728;&#x8FD4;&#x56DE;false,&#x4E0D;&#x5B58;&#x5728;&#x8FD4;&#x56DE;true
     * <span class="hljs-doctag">@return</span> the boolean
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">boolean</span> <span class="hljs-title">multiSetIfAbsent</span><span class="hljs-params">(Map&lt;String, String&gt; maps)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForValue().multiSetIfAbsent(maps);
    }

    <span class="hljs-comment">/**
     * &#x589E;&#x52A0;(&#x81EA;&#x589E;&#x957F;), &#x8D1F;&#x6570;&#x5219;&#x4E3A;&#x81EA;&#x51CF;
     *
     * <span class="hljs-doctag">@param</span> key       the key
     * <span class="hljs-doctag">@param</span> increment the increment
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">incrBy</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> increment)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForValue().increment(key, increment);
    }

    <span class="hljs-comment">/**
     * Incr by float double.
     *
     * <span class="hljs-doctag">@param</span> key       the key
     * <span class="hljs-doctag">@param</span> increment the increment
     * <span class="hljs-doctag">@return</span> the double
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Double <span class="hljs-title">incrByFloat</span><span class="hljs-params">(String key, <span class="hljs-keyword">double</span> increment)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForValue().increment(key, increment);
    }

    <span class="hljs-comment">/**
     * &#x8FFD;&#x52A0;&#x5230;&#x672B;&#x5C3E;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the integer
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Integer <span class="hljs-title">append</span><span class="hljs-params">(String key, String value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForValue().append(key, value);
    }

    <span class="hljs-comment">/** -------------------hash&#x76F8;&#x5173;&#x64CD;&#x4F5C;------------------------- */</span>

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x5B58;&#x50A8;&#x5728;&#x54C8;&#x5E0C;&#x8868;&#x4E2D;&#x6307;&#x5B9A;&#x5B57;&#x6BB5;&#x7684;&#x503C;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> field the field
     * <span class="hljs-doctag">@return</span> the object
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Object <span class="hljs-title">hGet</span><span class="hljs-params">(String key, String field)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForHash().get(key, field);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x6240;&#x6709;&#x7ED9;&#x5B9A;&#x5B57;&#x6BB5;&#x7684;&#x503C;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the map
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Map&lt;Object, Object&gt; <span class="hljs-title">hGetAll</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForHash().entries(key);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x6240;&#x6709;&#x7ED9;&#x5B9A;&#x5B57;&#x6BB5;&#x7684;&#x503C;
     *
     * <span class="hljs-doctag">@param</span> key    the key
     * <span class="hljs-doctag">@param</span> fields the fields
     * <span class="hljs-doctag">@return</span> the list
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> List&lt;Object&gt; <span class="hljs-title">hMultiGet</span><span class="hljs-params">(String key, Collection&lt;Object&gt; fields)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForHash().multiGet(key, fields);
    }

    <span class="hljs-comment">/**
     * H put.
     *
     * <span class="hljs-doctag">@param</span> key     the key
     * <span class="hljs-doctag">@param</span> hashKey the hash key
     * <span class="hljs-doctag">@param</span> value   the value
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">hPut</span><span class="hljs-params">(String key, String hashKey, String value)</span> </span>{
        redisTemplate.opsForHash().put(key, hashKey, value);
    }

    <span class="hljs-comment">/**
     * H put all.
     *
     * <span class="hljs-doctag">@param</span> key  the key
     * <span class="hljs-doctag">@param</span> maps the maps
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">hPutAll</span><span class="hljs-params">(String key, Map&lt;String, String&gt; maps)</span> </span>{
        redisTemplate.opsForHash().putAll(key, maps);
    }

    <span class="hljs-comment">/**
     * &#x4EC5;&#x5F53;hashKey&#x4E0D;&#x5B58;&#x5728;&#x65F6;&#x624D;&#x8BBE;&#x7F6E;
     *
     * <span class="hljs-doctag">@param</span> key     the key
     * <span class="hljs-doctag">@param</span> hashKey the hash key
     * <span class="hljs-doctag">@param</span> value   the value
     * <span class="hljs-doctag">@return</span> the boolean
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Boolean <span class="hljs-title">hPutIfAbsent</span><span class="hljs-params">(String key, String hashKey, String value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForHash().putIfAbsent(key, hashKey, value);
    }

    <span class="hljs-comment">/**
     * &#x5220;&#x9664;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x54C8;&#x5E0C;&#x8868;&#x5B57;&#x6BB5;
     *
     * <span class="hljs-doctag">@param</span> key    the key
     * <span class="hljs-doctag">@param</span> fields the fields
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">hDelete</span><span class="hljs-params">(String key, Object... fields)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForHash().delete(key, fields);
    }

    <span class="hljs-comment">/**
     * &#x67E5;&#x770B;&#x54C8;&#x5E0C;&#x8868; key &#x4E2D;&#xFF0C;&#x6307;&#x5B9A;&#x7684;&#x5B57;&#x6BB5;&#x662F;&#x5426;&#x5B58;&#x5728;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> field the field
     * <span class="hljs-doctag">@return</span> the boolean
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">boolean</span> <span class="hljs-title">hExists</span><span class="hljs-params">(String key, String field)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForHash().hasKey(key, field);
    }

    <span class="hljs-comment">/**
     * &#x4E3A;&#x54C8;&#x5E0C;&#x8868; key &#x4E2D;&#x7684;&#x6307;&#x5B9A;&#x5B57;&#x6BB5;&#x7684;&#x6574;&#x6570;&#x503C;&#x52A0;&#x4E0A;&#x589E;&#x91CF; increment
     *
     * <span class="hljs-doctag">@param</span> key       the key
     * <span class="hljs-doctag">@param</span> field     the field
     * <span class="hljs-doctag">@param</span> increment the increment
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">hIncrBy</span><span class="hljs-params">(String key, Object field, <span class="hljs-keyword">long</span> increment)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForHash().increment(key, field, increment);
    }

    <span class="hljs-comment">/**
     * &#x4E3A;&#x54C8;&#x5E0C;&#x8868; key &#x4E2D;&#x7684;&#x6307;&#x5B9A;&#x5B57;&#x6BB5;&#x7684;&#x6574;&#x6570;&#x503C;&#x52A0;&#x4E0A;&#x589E;&#x91CF; increment
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> field the field
     * <span class="hljs-doctag">@param</span> delta the delta
     * <span class="hljs-doctag">@return</span> the double
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Double <span class="hljs-title">hIncrByFloat</span><span class="hljs-params">(String key, Object field, <span class="hljs-keyword">double</span> delta)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForHash().increment(key, field, delta);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x6240;&#x6709;&#x54C8;&#x5E0C;&#x8868;&#x4E2D;&#x7684;&#x5B57;&#x6BB5;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;Object&gt; <span class="hljs-title">hKeys</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForHash().keys(key);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x54C8;&#x5E0C;&#x8868;&#x4E2D;&#x5B57;&#x6BB5;&#x7684;&#x6570;&#x91CF;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">hSize</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForHash().size(key);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x54C8;&#x5E0C;&#x8868;&#x4E2D;&#x6240;&#x6709;&#x503C;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the list
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> List&lt;Object&gt; <span class="hljs-title">hValues</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForHash().values(key);
    }

    <span class="hljs-comment">/**
     * &#x8FED;&#x4EE3;&#x54C8;&#x5E0C;&#x8868;&#x4E2D;&#x7684;&#x952E;&#x503C;&#x5BF9;
     *
     * <span class="hljs-doctag">@param</span> key     the key
     * <span class="hljs-doctag">@param</span> options the options
     * <span class="hljs-doctag">@return</span> the cursor
     */</span>
    <span class="hljs-keyword">public</span> Cursor&lt;Entry&lt;Object, Object&gt;&gt; hScan(String key, ScanOptions options) {
        <span class="hljs-keyword">return</span> redisTemplate.opsForHash().scan(key, options);
    }

    <span class="hljs-comment">/** ------------------------list&#x76F8;&#x5173;&#x64CD;&#x4F5C;---------------------------- */</span>

    <span class="hljs-comment">/**
     * &#x901A;&#x8FC7;&#x7D22;&#x5F15;&#x83B7;&#x53D6;&#x5217;&#x8868;&#x4E2D;&#x7684;&#x5143;&#x7D20;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> index the index
     * <span class="hljs-doctag">@return</span> the string
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">lIndex</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> index)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().index(key, index);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x5217;&#x8868;&#x6307;&#x5B9A;&#x8303;&#x56F4;&#x5185;&#x7684;&#x5143;&#x7D20;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> start &#x5F00;&#x59CB;&#x4F4D;&#x7F6E;, 0&#x662F;&#x5F00;&#x59CB;&#x4F4D;&#x7F6E;
     * <span class="hljs-doctag">@param</span> end   &#x7ED3;&#x675F;&#x4F4D;&#x7F6E;, -1&#x8FD4;&#x56DE;&#x6240;&#x6709;
     * <span class="hljs-doctag">@return</span> the list
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> List&lt;String&gt; <span class="hljs-title">lRange</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> start, <span class="hljs-keyword">long</span> end)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().range(key, start, end);
    }

    <span class="hljs-comment">/**
     * &#x5B58;&#x50A8;&#x5728;list&#x5934;&#x90E8;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">lLeftPush</span><span class="hljs-params">(String key, String value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().leftPush(key, value);
    }

    <span class="hljs-comment">/**
     * L left push all long.
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">lLeftPushAll</span><span class="hljs-params">(String key, String... value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().leftPushAll(key, value);
    }

    <span class="hljs-comment">/**
     * L left push all long.
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">lLeftPushAll</span><span class="hljs-params">(String key, Collection&lt;String&gt; value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().leftPushAll(key, value);
    }

    <span class="hljs-comment">/**
     * &#x5F53;list&#x5B58;&#x5728;&#x7684;&#x65F6;&#x5019;&#x624D;&#x52A0;&#x5165;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">lLeftPushIfPresent</span><span class="hljs-params">(String key, String value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().leftPushIfPresent(key, value);
    }

    <span class="hljs-comment">/**
     * &#x5982;&#x679C;pivot&#x5B58;&#x5728;,&#x518D;pivot&#x524D;&#x9762;&#x6DFB;&#x52A0;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> pivot the pivot
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">lLeftPush</span><span class="hljs-params">(String key, String pivot, String value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().leftPush(key, pivot, value);
    }

    <span class="hljs-comment">/**
     * L right push long.
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">lRightPush</span><span class="hljs-params">(String key, String value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().rightPush(key, value);
    }

    <span class="hljs-comment">/**
     * L right push all long.
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">lRightPushAll</span><span class="hljs-params">(String key, String... value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().rightPushAll(key, value);
    }

    <span class="hljs-comment">/**
     * L right push all long.
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">lRightPushAll</span><span class="hljs-params">(String key, Collection&lt;String&gt; value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().rightPushAll(key, value);
    }

    <span class="hljs-comment">/**
     * &#x4E3A;&#x5DF2;&#x5B58;&#x5728;&#x7684;&#x5217;&#x8868;&#x6DFB;&#x52A0;&#x503C;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">lRightPushIfPresent</span><span class="hljs-params">(String key, String value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().rightPushIfPresent(key, value);
    }

    <span class="hljs-comment">/**
     * &#x5728;pivot&#x5143;&#x7D20;&#x7684;&#x53F3;&#x8FB9;&#x6DFB;&#x52A0;&#x503C;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> pivot the pivot
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">lRightPush</span><span class="hljs-params">(String key, String pivot, String value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().rightPush(key, pivot, value);
    }

    <span class="hljs-comment">/**
     * &#x901A;&#x8FC7;&#x7D22;&#x5F15;&#x8BBE;&#x7F6E;&#x5217;&#x8868;&#x5143;&#x7D20;&#x7684;&#x503C;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> index &#x4F4D;&#x7F6E;
     * <span class="hljs-doctag">@param</span> value the value
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">lSet</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> index, String value)</span> </span>{
        redisTemplate.opsForList().set(key, index, value);
    }

    <span class="hljs-comment">/**
     * &#x79FB;&#x51FA;&#x5E76;&#x83B7;&#x53D6;&#x5217;&#x8868;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x5143;&#x7D20;
     *
     * <span class="hljs-doctag">@param</span> key &#x5220;&#x9664;&#x7684;&#x5143;&#x7D20;
     * <span class="hljs-doctag">@return</span> the string
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">lLeftPop</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().leftPop(key);
    }

    <span class="hljs-comment">/**
     * &#x79FB;&#x51FA;&#x5E76;&#x83B7;&#x53D6;&#x5217;&#x8868;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#xFF0C; &#x5982;&#x679C;&#x5217;&#x8868;&#x6CA1;&#x6709;&#x5143;&#x7D20;&#x4F1A;&#x963B;&#x585E;&#x5217;&#x8868;&#x76F4;&#x5230;&#x7B49;&#x5F85;&#x8D85;&#x65F6;&#x6216;&#x53D1;&#x73B0;&#x53EF;&#x5F39;&#x51FA;&#x5143;&#x7D20;&#x4E3A;&#x6B62;
     *
     * <span class="hljs-doctag">@param</span> key     the key
     * <span class="hljs-doctag">@param</span> timeout &#x7B49;&#x5F85;&#x65F6;&#x95F4;
     * <span class="hljs-doctag">@param</span> unit    &#x65F6;&#x95F4;&#x5355;&#x4F4D;
     * <span class="hljs-doctag">@return</span> the string
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">lBLeftPop</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> timeout, TimeUnit unit)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().leftPop(key, timeout, unit);
    }

    <span class="hljs-comment">/**
     * &#x79FB;&#x9664;&#x5E76;&#x83B7;&#x53D6;&#x5217;&#x8868;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x5143;&#x7D20;
     *
     * <span class="hljs-doctag">@param</span> key &#x5220;&#x9664;&#x7684;&#x5143;&#x7D20;
     * <span class="hljs-doctag">@return</span> the string
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">lRightPop</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().rightPop(key);
    }

    <span class="hljs-comment">/**
     * &#x79FB;&#x51FA;&#x5E76;&#x83B7;&#x53D6;&#x5217;&#x8868;&#x7684;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#xFF0C; &#x5982;&#x679C;&#x5217;&#x8868;&#x6CA1;&#x6709;&#x5143;&#x7D20;&#x4F1A;&#x963B;&#x585E;&#x5217;&#x8868;&#x76F4;&#x5230;&#x7B49;&#x5F85;&#x8D85;&#x65F6;&#x6216;&#x53D1;&#x73B0;&#x53EF;&#x5F39;&#x51FA;&#x5143;&#x7D20;&#x4E3A;&#x6B62;
     *
     * <span class="hljs-doctag">@param</span> key     the key
     * <span class="hljs-doctag">@param</span> timeout &#x7B49;&#x5F85;&#x65F6;&#x95F4;
     * <span class="hljs-doctag">@param</span> unit    &#x65F6;&#x95F4;&#x5355;&#x4F4D;
     * <span class="hljs-doctag">@return</span> the string
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">lBRightPop</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> timeout, TimeUnit unit)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().rightPop(key, timeout, unit);
    }

    <span class="hljs-comment">/**
     * &#x79FB;&#x9664;&#x5217;&#x8868;&#x7684;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#xFF0C;&#x5E76;&#x5C06;&#x8BE5;&#x5143;&#x7D20;&#x6DFB;&#x52A0;&#x5230;&#x53E6;&#x4E00;&#x4E2A;&#x5217;&#x8868;&#x5E76;&#x8FD4;&#x56DE;
     *
     * <span class="hljs-doctag">@param</span> sourceKey      the source key
     * <span class="hljs-doctag">@param</span> destinationKey the destination key
     * <span class="hljs-doctag">@return</span> the string
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">lRightPopAndLeftPush</span><span class="hljs-params">(String sourceKey, String destinationKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().rightPopAndLeftPush(sourceKey,
                destinationKey);
    }

    <span class="hljs-comment">/**
     * &#x4ECE;&#x5217;&#x8868;&#x4E2D;&#x5F39;&#x51FA;&#x4E00;&#x4E2A;&#x503C;&#xFF0C;&#x5C06;&#x5F39;&#x51FA;&#x7684;&#x5143;&#x7D20;&#x63D2;&#x5165;&#x5230;&#x53E6;&#x5916;&#x4E00;&#x4E2A;&#x5217;&#x8868;&#x4E2D;&#x5E76;&#x8FD4;&#x56DE;&#x5B83;&#xFF1B; &#x5982;&#x679C;&#x5217;&#x8868;&#x6CA1;&#x6709;&#x5143;&#x7D20;&#x4F1A;&#x963B;&#x585E;&#x5217;&#x8868;&#x76F4;&#x5230;&#x7B49;&#x5F85;&#x8D85;&#x65F6;&#x6216;&#x53D1;&#x73B0;&#x53EF;&#x5F39;&#x51FA;&#x5143;&#x7D20;&#x4E3A;&#x6B62;
     *
     * <span class="hljs-doctag">@param</span> sourceKey      the source key
     * <span class="hljs-doctag">@param</span> destinationKey the destination key
     * <span class="hljs-doctag">@param</span> timeout        the timeout
     * <span class="hljs-doctag">@param</span> unit           the unit
     * <span class="hljs-doctag">@return</span> the string
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">lBRightPopAndLeftPush</span><span class="hljs-params">(String sourceKey, String destinationKey,
            <span class="hljs-keyword">long</span> timeout, TimeUnit unit)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().rightPopAndLeftPush(sourceKey,
                destinationKey, timeout, unit);
    }

    <span class="hljs-comment">/**
     * &#x5220;&#x9664;&#x96C6;&#x5408;&#x4E2D;&#x503C;&#x7B49;&#x4E8E;value&#x5F97;&#x5143;&#x7D20;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> index index=0, &#x5220;&#x9664;&#x6240;&#x6709;&#x503C;&#x7B49;&#x4E8E;value&#x7684;&#x5143;&#x7D20;; index&gt;0, &#x4ECE;&#x5934;&#x90E8;&#x5F00;&#x59CB;&#x5220;&#x9664;&#x7B2C;&#x4E00;&#x4E2A;&#x503C;&#x7B49;&#x4E8E;value&#x7684;&#x5143;&#x7D20;;            index&lt;0, &#x4ECE;&#x5C3E;&#x90E8;&#x5F00;&#x59CB;&#x5220;&#x9664;&#x7B2C;&#x4E00;&#x4E2A;&#x503C;&#x7B49;&#x4E8E;value&#x7684;&#x5143;&#x7D20;;
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">lRemove</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> index, String value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().remove(key, index, value);
    }

    <span class="hljs-comment">/**
     * &#x88C1;&#x526A;list
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> start the start
     * <span class="hljs-doctag">@param</span> end   the end
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">lTrim</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> start, <span class="hljs-keyword">long</span> end)</span> </span>{
        redisTemplate.opsForList().trim(key, start, end);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x5217;&#x8868;&#x957F;&#x5EA6;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">lLen</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForList().size(key);
    }

    <span class="hljs-comment">/** --------------------set&#x76F8;&#x5173;&#x64CD;&#x4F5C;-------------------------- */</span>

    <span class="hljs-comment">/**
     * set&#x6DFB;&#x52A0;&#x5143;&#x7D20;
     *
     * <span class="hljs-doctag">@param</span> key    the key
     * <span class="hljs-doctag">@param</span> values the values
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">sAdd</span><span class="hljs-params">(String key, String... values)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().add(key, values);
    }

    <span class="hljs-comment">/**
     * set&#x79FB;&#x9664;&#x5143;&#x7D20;
     *
     * <span class="hljs-doctag">@param</span> key    the key
     * <span class="hljs-doctag">@param</span> values the values
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">sRemove</span><span class="hljs-params">(String key, Object... values)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().remove(key, values);
    }

    <span class="hljs-comment">/**
     * &#x79FB;&#x9664;&#x5E76;&#x8FD4;&#x56DE;&#x96C6;&#x5408;&#x7684;&#x4E00;&#x4E2A;&#x968F;&#x673A;&#x5143;&#x7D20;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the string
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">sPop</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().pop(key);
    }

    <span class="hljs-comment">/**
     * &#x5C06;&#x5143;&#x7D20;value&#x4ECE;&#x4E00;&#x4E2A;&#x96C6;&#x5408;&#x79FB;&#x5230;&#x53E6;&#x4E00;&#x4E2A;&#x96C6;&#x5408;
     *
     * <span class="hljs-doctag">@param</span> key     the key
     * <span class="hljs-doctag">@param</span> value   the value
     * <span class="hljs-doctag">@param</span> destKey the dest key
     * <span class="hljs-doctag">@return</span> the boolean
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Boolean <span class="hljs-title">sMove</span><span class="hljs-params">(String key, String value, String destKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().move(key, value, destKey);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x96C6;&#x5408;&#x7684;&#x5927;&#x5C0F;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">sSize</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().size(key);
    }

    <span class="hljs-comment">/**
     * &#x5224;&#x65AD;&#x96C6;&#x5408;&#x662F;&#x5426;&#x5305;&#x542B;value
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the boolean
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Boolean <span class="hljs-title">sIsMember</span><span class="hljs-params">(String key, Object value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().isMember(key, value);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x4E24;&#x4E2A;&#x96C6;&#x5408;&#x7684;&#x4EA4;&#x96C6;
     *
     * <span class="hljs-doctag">@param</span> key      the key
     * <span class="hljs-doctag">@param</span> otherKey the other key
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">sIntersect</span><span class="hljs-params">(String key, String otherKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().intersect(key, otherKey);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;key&#x96C6;&#x5408;&#x4E0E;&#x591A;&#x4E2A;&#x96C6;&#x5408;&#x7684;&#x4EA4;&#x96C6;
     *
     * <span class="hljs-doctag">@param</span> key       the key
     * <span class="hljs-doctag">@param</span> otherKeys the other keys
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">sIntersect</span><span class="hljs-params">(String key, Collection&lt;String&gt; otherKeys)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().intersect(key, otherKeys);
    }

    <span class="hljs-comment">/**
     * key&#x96C6;&#x5408;&#x4E0E;otherKey&#x96C6;&#x5408;&#x7684;&#x4EA4;&#x96C6;&#x5B58;&#x50A8;&#x5230;destKey&#x96C6;&#x5408;&#x4E2D;
     *
     * <span class="hljs-doctag">@param</span> key      the key
     * <span class="hljs-doctag">@param</span> otherKey the other key
     * <span class="hljs-doctag">@param</span> destKey  the dest key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">sIntersectAndStore</span><span class="hljs-params">(String key, String otherKey, String destKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().intersectAndStore(key, otherKey,
                destKey);
    }

    <span class="hljs-comment">/**
     * key&#x96C6;&#x5408;&#x4E0E;&#x591A;&#x4E2A;&#x96C6;&#x5408;&#x7684;&#x4EA4;&#x96C6;&#x5B58;&#x50A8;&#x5230;destKey&#x96C6;&#x5408;&#x4E2D;
     *
     * <span class="hljs-doctag">@param</span> key       the key
     * <span class="hljs-doctag">@param</span> otherKeys the other keys
     * <span class="hljs-doctag">@param</span> destKey   the dest key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">sIntersectAndStore</span><span class="hljs-params">(String key, Collection&lt;String&gt; otherKeys,
            String destKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().intersectAndStore(key, otherKeys,
                destKey);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x4E24;&#x4E2A;&#x96C6;&#x5408;&#x7684;&#x5E76;&#x96C6;
     *
     * <span class="hljs-doctag">@param</span> key       the key
     * <span class="hljs-doctag">@param</span> otherKeys the other keys
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">sUnion</span><span class="hljs-params">(String key, String otherKeys)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().union(key, otherKeys);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;key&#x96C6;&#x5408;&#x4E0E;&#x591A;&#x4E2A;&#x96C6;&#x5408;&#x7684;&#x5E76;&#x96C6;
     *
     * <span class="hljs-doctag">@param</span> key       the key
     * <span class="hljs-doctag">@param</span> otherKeys the other keys
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">sUnion</span><span class="hljs-params">(String key, Collection&lt;String&gt; otherKeys)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().union(key, otherKeys);
    }

    <span class="hljs-comment">/**
     * key&#x96C6;&#x5408;&#x4E0E;otherKey&#x96C6;&#x5408;&#x7684;&#x5E76;&#x96C6;&#x5B58;&#x50A8;&#x5230;destKey&#x4E2D;
     *
     * <span class="hljs-doctag">@param</span> key      the key
     * <span class="hljs-doctag">@param</span> otherKey the other key
     * <span class="hljs-doctag">@param</span> destKey  the dest key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">sUnionAndStore</span><span class="hljs-params">(String key, String otherKey, String destKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().unionAndStore(key, otherKey, destKey);
    }

    <span class="hljs-comment">/**
     * key&#x96C6;&#x5408;&#x4E0E;&#x591A;&#x4E2A;&#x96C6;&#x5408;&#x7684;&#x5E76;&#x96C6;&#x5B58;&#x50A8;&#x5230;destKey&#x4E2D;
     *
     * <span class="hljs-doctag">@param</span> key       the key
     * <span class="hljs-doctag">@param</span> otherKeys the other keys
     * <span class="hljs-doctag">@param</span> destKey   the dest key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">sUnionAndStore</span><span class="hljs-params">(String key, Collection&lt;String&gt; otherKeys,
            String destKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().unionAndStore(key, otherKeys, destKey);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x4E24;&#x4E2A;&#x96C6;&#x5408;&#x7684;&#x5DEE;&#x96C6;
     *
     * <span class="hljs-doctag">@param</span> key      the key
     * <span class="hljs-doctag">@param</span> otherKey the other key
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">sDifference</span><span class="hljs-params">(String key, String otherKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().difference(key, otherKey);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;key&#x96C6;&#x5408;&#x4E0E;&#x591A;&#x4E2A;&#x96C6;&#x5408;&#x7684;&#x5DEE;&#x96C6;
     *
     * <span class="hljs-doctag">@param</span> key       the key
     * <span class="hljs-doctag">@param</span> otherKeys the other keys
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">sDifference</span><span class="hljs-params">(String key, Collection&lt;String&gt; otherKeys)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().difference(key, otherKeys);
    }

    <span class="hljs-comment">/**
     * key&#x96C6;&#x5408;&#x4E0E;otherKey&#x96C6;&#x5408;&#x7684;&#x5DEE;&#x96C6;&#x5B58;&#x50A8;&#x5230;destKey&#x4E2D;
     *
     * <span class="hljs-doctag">@param</span> key      the key
     * <span class="hljs-doctag">@param</span> otherKey the other key
     * <span class="hljs-doctag">@param</span> destKey  the dest key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">sDifference</span><span class="hljs-params">(String key, String otherKey, String destKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().differenceAndStore(key, otherKey,
                destKey);
    }

    <span class="hljs-comment">/**
     * key&#x96C6;&#x5408;&#x4E0E;&#x591A;&#x4E2A;&#x96C6;&#x5408;&#x7684;&#x5DEE;&#x96C6;&#x5B58;&#x50A8;&#x5230;destKey&#x4E2D;
     *
     * <span class="hljs-doctag">@param</span> key       the key
     * <span class="hljs-doctag">@param</span> otherKeys the other keys
     * <span class="hljs-doctag">@param</span> destKey   the dest key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">sDifference</span><span class="hljs-params">(String key, Collection&lt;String&gt; otherKeys,
            String destKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().differenceAndStore(key, otherKeys,
                destKey);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x96C6;&#x5408;&#x6240;&#x6709;&#x5143;&#x7D20;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the members
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">setMembers</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().members(key);
    }

    <span class="hljs-comment">/**
     * &#x968F;&#x673A;&#x83B7;&#x53D6;&#x96C6;&#x5408;&#x4E2D;&#x7684;&#x4E00;&#x4E2A;&#x5143;&#x7D20;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the string
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">sRandomMember</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().randomMember(key);
    }

    <span class="hljs-comment">/**
     * &#x968F;&#x673A;&#x83B7;&#x53D6;&#x96C6;&#x5408;&#x4E2D;count&#x4E2A;&#x5143;&#x7D20;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> count the count
     * <span class="hljs-doctag">@return</span> the list
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> List&lt;String&gt; <span class="hljs-title">sRandomMembers</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> count)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().randomMembers(key, count);
    }

    <span class="hljs-comment">/**
     * &#x968F;&#x673A;&#x83B7;&#x53D6;&#x96C6;&#x5408;&#x4E2D;count&#x4E2A;&#x5143;&#x7D20;&#x5E76;&#x4E14;&#x53BB;&#x9664;&#x91CD;&#x590D;&#x7684;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> count the count
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">sDistinctRandomMembers</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> count)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().distinctRandomMembers(key, count);
    }

    <span class="hljs-comment">/**
     * S scan cursor.
     *
     * <span class="hljs-doctag">@param</span> key     the key
     * <span class="hljs-doctag">@param</span> options the options
     * <span class="hljs-doctag">@return</span> the cursor
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Cursor&lt;String&gt; <span class="hljs-title">sScan</span><span class="hljs-params">(String key, ScanOptions options)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForSet().scan(key, options);
    }

    <span class="hljs-comment">/**------------------zSet&#x76F8;&#x5173;&#x64CD;&#x4F5C;--------------------------------*/</span>

    <span class="hljs-comment">/**
     * &#x6DFB;&#x52A0;&#x5143;&#x7D20;,&#x6709;&#x5E8F;&#x96C6;&#x5408;&#x662F;&#x6309;&#x7167;&#x5143;&#x7D20;&#x7684;score&#x503C;&#x7531;&#x5C0F;&#x5230;&#x5927;&#x6392;&#x5217;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@param</span> score the score
     * <span class="hljs-doctag">@return</span> the boolean
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Boolean <span class="hljs-title">zAdd</span><span class="hljs-params">(String key, String value, <span class="hljs-keyword">double</span> score)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().add(key, value, score);
    }

    <span class="hljs-comment">/**
     * Z add long.
     *
     * <span class="hljs-doctag">@param</span> key    the key
     * <span class="hljs-doctag">@param</span> values the values
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">zAdd</span><span class="hljs-params">(String key, Set&lt;TypedTuple&lt;String&gt;&gt; values)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().add(key, values);
    }

    <span class="hljs-comment">/**
     * Z remove long.
     *
     * <span class="hljs-doctag">@param</span> key    the key
     * <span class="hljs-doctag">@param</span> values the values
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">zRemove</span><span class="hljs-params">(String key, Object... values)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().remove(key, values);
    }

    <span class="hljs-comment">/**
     * &#x589E;&#x52A0;&#x5143;&#x7D20;&#x7684;score&#x503C;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x589E;&#x52A0;&#x540E;&#x7684;&#x503C;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@param</span> delta the delta
     * <span class="hljs-doctag">@return</span> the double
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Double <span class="hljs-title">zIncrementScore</span><span class="hljs-params">(String key, String value, <span class="hljs-keyword">double</span> delta)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().incrementScore(key, value, delta);
    }

    <span class="hljs-comment">/**
     * &#x8FD4;&#x56DE;&#x5143;&#x7D20;&#x5728;&#x96C6;&#x5408;&#x7684;&#x6392;&#x540D;,&#x6709;&#x5E8F;&#x96C6;&#x5408;&#x662F;&#x6309;&#x7167;&#x5143;&#x7D20;&#x7684;score&#x503C;&#x7531;&#x5C0F;&#x5230;&#x5927;&#x6392;&#x5217;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value 0&#x8868;&#x793A;&#x7B2C;&#x4E00;&#x4F4D;
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">zRank</span><span class="hljs-params">(String key, Object value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().rank(key, value);
    }

    <span class="hljs-comment">/**
     * &#x8FD4;&#x56DE;&#x5143;&#x7D20;&#x5728;&#x96C6;&#x5408;&#x7684;&#x6392;&#x540D;,&#x6309;&#x5143;&#x7D20;&#x7684;score&#x503C;&#x7531;&#x5927;&#x5230;&#x5C0F;&#x6392;&#x5217;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">zReverseRank</span><span class="hljs-params">(String key, Object value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().reverseRank(key, value);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x96C6;&#x5408;&#x7684;&#x5143;&#x7D20;, &#x4ECE;&#x5C0F;&#x5230;&#x5927;&#x6392;&#x5E8F;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> start &#x5F00;&#x59CB;&#x4F4D;&#x7F6E;
     * <span class="hljs-doctag">@param</span> end   &#x7ED3;&#x675F;&#x4F4D;&#x7F6E;, -1&#x67E5;&#x8BE2;&#x6240;&#x6709;
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">zRange</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> start, <span class="hljs-keyword">long</span> end)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().range(key, start, end);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x96C6;&#x5408;&#x5143;&#x7D20;, &#x5E76;&#x4E14;&#x628A;score&#x503C;&#x4E5F;&#x83B7;&#x53D6;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> start the start
     * <span class="hljs-doctag">@param</span> end   the end
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-keyword">public</span> Set&lt;TypedTuple&lt;String&gt;&gt; zRangeWithScores(String key, <span class="hljs-keyword">long</span> start,
            <span class="hljs-keyword">long</span> end) {
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().rangeWithScores(key, start, end);
    }

    <span class="hljs-comment">/**
     * &#x6839;&#x636E;Score&#x503C;&#x67E5;&#x8BE2;&#x96C6;&#x5408;&#x5143;&#x7D20;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@param</span> min &#x6700;&#x5C0F;&#x503C;
     * <span class="hljs-doctag">@param</span> max &#x6700;&#x5927;&#x503C;
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">zRangeByScore</span><span class="hljs-params">(String key, <span class="hljs-keyword">double</span> min, <span class="hljs-keyword">double</span> max)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().rangeByScore(key, min, max);
    }

    <span class="hljs-comment">/**
     * &#x6839;&#x636E;Score&#x503C;&#x67E5;&#x8BE2;&#x96C6;&#x5408;&#x5143;&#x7D20;, &#x4ECE;&#x5C0F;&#x5230;&#x5927;&#x6392;&#x5E8F;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@param</span> min &#x6700;&#x5C0F;&#x503C;
     * <span class="hljs-doctag">@param</span> max &#x6700;&#x5927;&#x503C;
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-keyword">public</span> Set&lt;TypedTuple&lt;String&gt;&gt; zRangeByScoreWithScores(String key,
            <span class="hljs-keyword">double</span> min, <span class="hljs-keyword">double</span> max) {
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().rangeByScoreWithScores(key, min, max);
    }

    <span class="hljs-comment">/**
     * Z range by score with scores set.
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> min   the min
     * <span class="hljs-doctag">@param</span> max   the max
     * <span class="hljs-doctag">@param</span> start the start
     * <span class="hljs-doctag">@param</span> end   the end
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-keyword">public</span> Set&lt;TypedTuple&lt;String&gt;&gt; zRangeByScoreWithScores(String key,
            <span class="hljs-keyword">double</span> min, <span class="hljs-keyword">double</span> max, <span class="hljs-keyword">long</span> start, <span class="hljs-keyword">long</span> end) {
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().rangeByScoreWithScores(key, min, max,
                start, end);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x96C6;&#x5408;&#x7684;&#x5143;&#x7D20;, &#x4ECE;&#x5927;&#x5230;&#x5C0F;&#x6392;&#x5E8F;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> start the start
     * <span class="hljs-doctag">@param</span> end   the end
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">zReverseRange</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> start, <span class="hljs-keyword">long</span> end)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().reverseRange(key, start, end);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x96C6;&#x5408;&#x7684;&#x5143;&#x7D20;, &#x4ECE;&#x5927;&#x5230;&#x5C0F;&#x6392;&#x5E8F;, &#x5E76;&#x8FD4;&#x56DE;score&#x503C;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> start the start
     * <span class="hljs-doctag">@param</span> end   the end
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-keyword">public</span> Set&lt;TypedTuple&lt;String&gt;&gt; zReverseRangeWithScores(String key,
            <span class="hljs-keyword">long</span> start, <span class="hljs-keyword">long</span> end) {
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().reverseRangeWithScores(key, start,
                end);
    }

    <span class="hljs-comment">/**
     * &#x6839;&#x636E;Score&#x503C;&#x67E5;&#x8BE2;&#x96C6;&#x5408;&#x5143;&#x7D20;, &#x4ECE;&#x5927;&#x5230;&#x5C0F;&#x6392;&#x5E8F;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@param</span> min the min
     * <span class="hljs-doctag">@param</span> max the max
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">zReverseRangeByScore</span><span class="hljs-params">(String key, <span class="hljs-keyword">double</span> min,
            <span class="hljs-keyword">double</span> max)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().reverseRangeByScore(key, min, max);
    }

    <span class="hljs-comment">/**
     * &#x6839;&#x636E;Score&#x503C;&#x67E5;&#x8BE2;&#x96C6;&#x5408;&#x5143;&#x7D20;, &#x4ECE;&#x5927;&#x5230;&#x5C0F;&#x6392;&#x5E8F;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@param</span> min the min
     * <span class="hljs-doctag">@param</span> max the max
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-keyword">public</span> Set&lt;TypedTuple&lt;String&gt;&gt; zReverseRangeByScoreWithScores(
            String key, <span class="hljs-keyword">double</span> min, <span class="hljs-keyword">double</span> max) {
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().reverseRangeByScoreWithScores(key,
                min, max);
    }

    <span class="hljs-comment">/**
     * Z reverse range by score set.
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> min   the min
     * <span class="hljs-doctag">@param</span> max   the max
     * <span class="hljs-doctag">@param</span> start the start
     * <span class="hljs-doctag">@param</span> end   the end
     * <span class="hljs-doctag">@return</span> the set
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Set&lt;String&gt; <span class="hljs-title">zReverseRangeByScore</span><span class="hljs-params">(String key, <span class="hljs-keyword">double</span> min,
            <span class="hljs-keyword">double</span> max, <span class="hljs-keyword">long</span> start, <span class="hljs-keyword">long</span> end)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().reverseRangeByScore(key, min, max,
                start, end);
    }

    <span class="hljs-comment">/**
     * &#x6839;&#x636E;score&#x503C;&#x83B7;&#x53D6;&#x96C6;&#x5408;&#x5143;&#x7D20;&#x6570;&#x91CF;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@param</span> min the min
     * <span class="hljs-doctag">@param</span> max the max
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">zCount</span><span class="hljs-params">(String key, <span class="hljs-keyword">double</span> min, <span class="hljs-keyword">double</span> max)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().count(key, min, max);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x96C6;&#x5408;&#x5927;&#x5C0F;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">zSize</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().size(key);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x96C6;&#x5408;&#x5927;&#x5C0F;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">zZCard</span><span class="hljs-params">(String key)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().zCard(key);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;&#x96C6;&#x5408;&#x4E2D;value&#x5143;&#x7D20;&#x7684;score&#x503C;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> value the value
     * <span class="hljs-doctag">@return</span> the double
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Double <span class="hljs-title">zScore</span><span class="hljs-params">(String key, Object value)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().score(key, value);
    }

    <span class="hljs-comment">/**
     * &#x79FB;&#x9664;&#x6307;&#x5B9A;&#x7D22;&#x5F15;&#x4F4D;&#x7F6E;&#x7684;&#x6210;&#x5458;
     *
     * <span class="hljs-doctag">@param</span> key   the key
     * <span class="hljs-doctag">@param</span> start the start
     * <span class="hljs-doctag">@param</span> end   the end
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">zRemoveRange</span><span class="hljs-params">(String key, <span class="hljs-keyword">long</span> start, <span class="hljs-keyword">long</span> end)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().removeRange(key, start, end);
    }

    <span class="hljs-comment">/**
     * &#x6839;&#x636E;&#x6307;&#x5B9A;&#x7684;score&#x503C;&#x7684;&#x8303;&#x56F4;&#x6765;&#x79FB;&#x9664;&#x6210;&#x5458;
     *
     * <span class="hljs-doctag">@param</span> key the key
     * <span class="hljs-doctag">@param</span> min the min
     * <span class="hljs-doctag">@param</span> max the max
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">zRemoveRangeByScore</span><span class="hljs-params">(String key, <span class="hljs-keyword">double</span> min, <span class="hljs-keyword">double</span> max)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().removeRangeByScore(key, min, max);
    }

    <span class="hljs-comment">/**
     * &#x83B7;&#x53D6;key&#x548C;otherKey&#x7684;&#x5E76;&#x96C6;&#x5E76;&#x5B58;&#x50A8;&#x5728;destKey&#x4E2D;
     *
     * <span class="hljs-doctag">@param</span> key      the key
     * <span class="hljs-doctag">@param</span> otherKey the other key
     * <span class="hljs-doctag">@param</span> destKey  the dest key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">zUnionAndStore</span><span class="hljs-params">(String key, String otherKey, String destKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().unionAndStore(key, otherKey, destKey);
    }

    <span class="hljs-comment">/**
     * Z union and store long.
     *
     * <span class="hljs-doctag">@param</span> key       the key
     * <span class="hljs-doctag">@param</span> otherKeys the other keys
     * <span class="hljs-doctag">@param</span> destKey   the dest key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">zUnionAndStore</span><span class="hljs-params">(String key, Collection&lt;String&gt; otherKeys,
            String destKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet()
                .unionAndStore(key, otherKeys, destKey);
    }

    <span class="hljs-comment">/**
     * &#x4EA4;&#x96C6;
     *
     * <span class="hljs-doctag">@param</span> key      the key
     * <span class="hljs-doctag">@param</span> otherKey the other key
     * <span class="hljs-doctag">@param</span> destKey  the dest key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">zIntersectAndStore</span><span class="hljs-params">(String key, String otherKey,
            String destKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().intersectAndStore(key, otherKey,
                destKey);
    }

    <span class="hljs-comment">/**
     * &#x4EA4;&#x96C6;
     *
     * <span class="hljs-doctag">@param</span> key       the key
     * <span class="hljs-doctag">@param</span> otherKeys the other keys
     * <span class="hljs-doctag">@param</span> destKey   the dest key
     * <span class="hljs-doctag">@return</span> the long
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">zIntersectAndStore</span><span class="hljs-params">(String key, Collection&lt;String&gt; otherKeys,
            String destKey)</span> </span>{
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().intersectAndStore(key, otherKeys,
                destKey);
    }

    <span class="hljs-comment">/**
     * Z scan cursor.
     *
     * <span class="hljs-doctag">@param</span> key     the key
     * <span class="hljs-doctag">@param</span> options the options
     * <span class="hljs-doctag">@return</span> the cursor
     */</span>
    <span class="hljs-keyword">public</span> Cursor&lt;TypedTuple&lt;String&gt;&gt; zScan(String key, ScanOptions options) {
        <span class="hljs-keyword">return</span> redisTemplate.opsForZSet().scan(key, options);
    }
}
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="redis15 springBoot整合redis.html" class="navigation navigation-prev " aria-label="Previous page: redis15 springBoot整合redis">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="redis17 Redis.config详解.html" class="navigation navigation-next " aria-label="Next page: redis17 Redis.config详解">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"redis16 RedisUtil","level":"1.17","depth":1,"next":{"title":"redis17 Redis.config详解","level":"1.18","depth":1,"path":"redis17 Redis.config详解.md","ref":"redis17 Redis.config详解.md","articles":[]},"previous":{"title":"redis15 springBoot整合redis","level":"1.16","depth":1,"path":"redis15 springBoot整合redis.md","ref":"redis15 springBoot整合redis.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"<yangxin19970404@163.com>","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Redis","language":"zh-hans","gitbook":"3.2.3","description":"Redis > 缓存技术"},"file":{"path":"redis16 RedisUtil.md","mtime":"2021-03-19T11:39:39.366Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-04-17T07:48:08.480Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

